package com.yh.ssm.controller;

import com.yh.ssm.common.Result;
import com.yh.ssm.form.TreplyForm;
import com.yh.ssm.query.TreplyQuery;
import com.yh.ssm.service.TReplyService;
import com.yh.ssm.service.TTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: TReplyController.java [评论处理器]
 * @author: yuhui
 * @version: 1.0.0
 * @Description: TODO
 * @createTime: 2021年04月29日 09:52:00
 */
@RestController
@RequestMapping("tr")
public class TReplyController {
    @Autowired
    private TReplyService tReplyService;

    @RequestMapping("list")
    public Result list(TreplyQuery treplyQuery){
        Result infoByTopicID = tReplyService.getInfoByTopicID(treplyQuery);
        return infoByTopicID;
    }

    @RequestMapping("add")
    public Result addNewpeply(TreplyForm treplyForm){
        Result result = tReplyService.addInfo(treplyForm);
        return result;
    }
}
